package com.achievement.entity;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.exam.entity.Exam;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.mark.entity.StuAnswer;
import com.user.entity.Student;

@Entity
@Table(name="t_score")
public class Score {
	private Long id;
	private float score;
	private Exam exam;
	private Course course;
	private StuAnswer stuAnswer;
	private Student student;
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}
	public float getScore() {
		return score;
	}
	@ManyToOne(fetch=FetchType.EAGER)
	public Exam getExam() {
		return exam;
	}
	@JsonIgnore
	@ManyToOne(fetch=FetchType.LAZY)
	public StuAnswer getStuAnswer() {
		return stuAnswer;
	}
	@ManyToOne(fetch=FetchType.EAGER)
	public Student getStudent() {
		return student;
	}
	@ManyToOne(fetch=FetchType.EAGER)
	public Course getCourse() {
		return course;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public void setScore(float score) {
		this.score = score;
	}
	public void setExam(Exam exam) {
		this.exam = exam;
	}
	public void setStuAnswer(StuAnswer stuAnswer) {
		this.stuAnswer = stuAnswer;
	}
	public void setStudent(Student student) {
		this.student = student;
	}
	public void setCourse(Course course) {
		this.course = course;
	}
	
}
